import './assets/main.css'
import './assets/base.css'
import './assets/global.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
// 自适应组件
import FitScreen from '@fit-screen/vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCN from 'element-plus/dist/locale/zh-cn.mjs' //引入中文
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 引入echarts
import Echarts from 'vue-echarts'

import 'virtual:svg-icons-register'

import App from './App.vue'
import router from './router'

// 注册全局组件
import ScreenFit from '@/components/screen-fit/screen-fit.vue'
import svgIcon from '@/components/SvgIcon.vue'
import Empty from '@/components/Empty.vue'
import FullScreen from '@/components/FullScreen.vue'

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

const app = createApp(App)
// 引入图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.component('e-charts', Echarts)
app.component('ScreenFit', ScreenFit)
app.component('svgIcon', svgIcon)
app.use(FitScreen)
app.use(ElementPlus, { locale: zhCN })
app.use(pinia)
app.use(router)
app.mount('#app')
